﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VolunteerHubAdapter
{
    class FieldHelper
    {
        public static void SetDefaultFieldMapping(OmaticIO.Base.Import.ImportProfileBase profile)
        {
            foreach (OmaticIO.Base.Import.ImportFieldMapInfo f in profile.FieldMapping)
            {
                switch (f.Name)
                {
                    case "EventName":
                        f.RecordType = OmaticIO.Base.RecordTypes.RecordType_VolunteerJob;
                        f.ValueType = (int)Blackbaud.PIA.RE7.BBREAPI.EJobAssignmentFields.JobAssignment_fld_JOB_ID;
                        f.Group = 1;
                        break;

                    case "EventShortDescription":
                        f.RecordType = OmaticIO.Base.RecordTypes.RecordType_VolunteerJob;
                        f.ValueType = (int)Blackbaud.PIA.RE7.BBREAPI.EJobAssignmentFields.JobAssignment_fld_TASK;
                        f.Group = 1;
                        break;

                    case "StartTime":
                        f.RecordType = OmaticIO.Base.RecordTypes.RecordType_VolunteerJob;
                        f.ValueType = (int)Blackbaud.PIA.RE7.BBREAPI.EJobAssignmentFields.JobAssignment_fld_START_TIME;
                        f.Group = 1;
                        break;

                    case "EndTime":
                        f.RecordType = OmaticIO.Base.RecordTypes.RecordType_VolunteerJob;
                        f.ValueType = (int)Blackbaud.PIA.RE7.BBREAPI.EJobAssignmentFields.JobAssignment_fld_END_TIME;
                        f.Group = 1;
                        break;

                    default:
                        break;
                }
            }
        }
    }
}
